package main.java.indi.zyj.hot100;

import java.util.Arrays;
import java.util.Map;

public class _56_lengthOfLIS {
    public int lengthOfLIS(int[] nums) {

        int res = 1;
        int len = nums.length;
        int[] dp = new int[len];
        Arrays.fill(dp, 1);

        for (int i = 1; i < len; i++) {
            for (int j = i - 1; j >= 0; j--) {
                if (nums[i] > nums[j]){
                    dp[i] = Math.max(dp[j] + 1, dp[i]);
                }
            }
            res = Math.max(res, dp[i]);
        }


        return res;

    }
}
